﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;

namespace SampleWebApplication
{
    public class Db_connect
    {
        string connectString = "Data Source=MSHOME;Initial Catalog=Company;Integrated Security=true";
        
        public Db_connect() {
        }

        public DataSet GetDataSet(string query){

            SqlConnection conn = new SqlConnection(connectString);
            conn.Open();
            SqlDataAdapter da = new SqlDataAdapter(query, conn);
            DataSet ds = new DataSet();
            da.Fill(ds);
            return ds;
        }
        public bool insertDeleteUpdateValues(String Query)
        {
            SqlConnection conn1 = new SqlConnection(connectString);
            SqlCommand comm1 = new SqlCommand(Query, conn1);
            conn1.Open();
            comm1.ExecuteNonQuery();
            return true;
        }
        
    }
}